Communication Protocols
ASI BAC controllers support multiple communication protocols for configuration, monitoring, and network control.
Available Protocols
| Protocol | Interface | Use Case |
|---|---|---|
| CANopen | CAN Bus | Network control, multi-device systems |
| MODBUS | Serial (TTL) | Simple serial communication |
| TTL Serial | Direct | Configuration, debugging |
CANopen Protocol
Overview
CANopen is the primary network protocol for BAC controllers, enabling:
- Remote motor control
- Real-time telemetry
- Multi-device networks
- Parameter configuration
Critical Timeout Parameters
Three essential parameters ensure reliable operation:
| Parameter | Typical Value | Purpose |
|---|---|---|
| Command Timeout Threshold | 1000ms | Single sample timeout |
| Average Command Timeout Threshold | 250ms | 100-sample average timeout |
| CAN Sync Loss Timeout | Application-specific | RPDO timing compliance |
Critical Warning
Not setting timeout thresholds may result in inability to disable the motor if communication is lost.
Watchdog Counter Implementation
A rolling counter mechanism is required for reliable operation:
You must send a rolling counter on the high byte of Remote state command on a heartbeat within the timeout thresholds.
Remote State Command Format:
| Byte | Content |
|---|---|
| High byte | Rolling counter (0-255) |
| Low byte | State: 0=Off, 1=Idle, 2=Active |
Send heartbeat at 100ms intervals with incrementing counter.
Fault Behaviors
Network Communication Timeout (Fault bit 8)
- Trigger: Communication loss exceeding timeout
- Behavior: Disables motor until power cycle
- LED Flash: 2-1 sequence
Communication Loss Braking
Activates only in remote speed mode with serial stream control:
- Limits braking current to
Remote comm loss braking current - Duration: 10 seconds maximum
Local Mode Operation
When using throttle input locally, prevent timeout faults by:
- Sending heartbeat counter above 255 (0x0100 to 0xFF00 range)
- Maintaining heartbeat within timeout thresholds
PDO Configuration
TPDO (Transmit PDOs)
| TPDO | Content | COB-ID |
|---|---|---|
| TPDO-1 | Fixed data set 1 | Base + Node-ID |
| TPDO-2 | Fixed data set 2 | Base + Node-ID |
Broadcast timing is configurable per application requirements.
RPDO (Receive PDOs)
Configure RPDO timing to match your network's sync rate to avoid CAN Sync Loss faults.
Remote Control Modes
Speed Mode (Regulator Mode 0)
| Parameter | Description |
|---|---|
| Remote speed command | % of rated speed (signed for direction) |
| Remote speed command in RPM | Direct RPM target |
| Remote state command | Set to 2 (Run) to enable |
Torque Mode (Regulator Mode 1)
No speed control - motor spins based on applied current:
| Parameter | Description |
|---|---|
| Remote torque command | % of phase current (signed for direction) |
Torque with Speed Limiting (Mode 2)
Combines torque and speed parameters:
- Requires complementary sign alignment
- Speed limits torque application
Current Limits
Both modes require setting:
| Parameter | Function |
|---|---|
| Remote Maximum Motoring Current | Phase current limit for driving |
| Remote Maximum Braking Current | Regen capacity limit |
Regen via Network
To control regen braking via CAN:
- Set
Regen brake sourceto "Network" - Configure
Remote Maximum Braking Current - Send braking commands via Remote torque command (negative values)
Priority (Firmware 6.014+): When both engine braking and network regen are active, the controller applies whichever commands higher braking torque.
MODBUS Protocol
Overview
MODBUS provides simpler serial communication for basic control and monitoring.
Key Resources
- Protocol Document: ASI Modbus Protocol Rev 1.22 (PDF)
- CRC Calculation: Use CRC16 - Modbus specifically
Implementation
Refer to the ASI Modbus Protocol document for:
- Register mappings
- Function codes
- Message formatting
- Error handling
TTL Serial Communication
Connection
| Pin | Function |
|---|---|
| 17 | TTL TX |
| 18 | TTL RX |
| GND | Signal ground |
Usage
- Direct connection to BACDoor software
- Parameter configuration
- Real-time monitoring
- Firmware updates
USB Isolator Required
Always use a USB isolator between your computer and the controller to prevent ground loops and protect equipment.
Display Integration
Supported Protocols
| Protocol | Display Types |
|---|---|
| CAN-based | King Meter, Bafang, Wuxing, proprietary |
| TTL-based | Various third-party displays |
Configuration Steps
- Activate
Communications configuration vector bit 10(Enable Ebike) - Select appropriate display protocol
- Set assist mode source to display
- Configure walk mode signal source
- Input wheel diameter and speed sensor parameters
Wiring Options
| Configuration | Description |
|---|---|
| CAN + keyout | Display controls power |
| CAN + external switch | Separate power control |
| TTL + keyout | Display controls power |
| TTL + external switch | Separate power control |
Voltage Hazard
The B+ Pin outputs battery voltage. Verify display compatibility before connecting. Incorrect wiring can damage components.
Network Telemetry
Available Data
Real-time parameters accessible via network:
| Category | Parameters |
|---|---|
| Voltage | Battery voltage (filtered) |
| Current | Motor phase currents |
| Temperature | Controller, motor (if sensor connected) |
| Speed | Motor RPM, vehicle speed |
| Status | Fault/warning registers |
Fault/Warning Registers
| Address | Content |
|---|---|
| 258 | Faults (16 conditions) |
| 277 | Warnings (protective foldbacks) |
| 62, 1964, 1965 | Flash codes |
TPDO Timing
Configure broadcast intervals based on:
- Network bandwidth
- Required update rate
- Number of devices
CAN Bus Hardware
Termination
CAN bus requires 120Ω termination resistors at each end:
- BAC controllers have configurable internal termination
- Total bus resistance should measure ~60Ω between CAN-H and CAN-L
Testing
- Measure resistance between CAN-H and CAN-L
- Expected: ~60Ω with two terminators
- Use PEAK CAN dongle with PCAN viewer for traffic analysis
Configuration Checklist
CANopen Setup
Set Node ID
Configure unique node ID for each controller on the bus.
Configure Timeouts
Set Command Timeout and Average Command Timeout thresholds.
Enable Watchdog
Implement rolling counter on Remote state command.
Configure PDOs
Set up TPDO/RPDO mappings and timing.
Set Control Mode
Choose Speed, Torque, or Torque with Speed Limiting.
Configure Current Limits
Set motoring and braking current limits.
Test Communication
Verify heartbeat, commands, and telemetry.
MODBUS Setup
- Configure baud rate
- Set device address
- Verify CRC implementation (CRC16-Modbus)
- Test register read/write operations
Next Steps
- Configure Software Tools for monitoring
- Review Protection Systems for fault handling
- Check Technical Q&A for common questions