100% found this document useful (1 vote)
3K views20 pages

Emc Donate Version Tutorial

This document provides instructions for flashing firmware and using various features of the EMC-M3 simulator hardware. It supports the BLACKPILL and SMARTV2 boards with STM32F103C8T6 MCU as well as the ARDUINO LEONARDO. Users can flash firmware using an ST-LINK debugger or USB serial. The utility supports steering, pedals, handbrake and shifter calibration. Force feedback effects like strength, reducer and ballast can be configured. For encoders with a Z index, wheel auto-centering is possible through firmware calibration.

Uploaded by

PIETREK PRO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views20 pages

Emc Donate Version Tutorial

This document provides instructions for flashing firmware and using various features of the EMC-M3 simulator hardware. It supports the BLACKPILL and SMARTV2 boards with STM32F103C8T6 MCU as well as the ARDUINO LEONARDO. Users can flash firmware using an ST-LINK debugger or USB serial. The utility supports steering, pedals, handbrake and shifter calibration. Force feedback effects like strength, reducer and ballast can be configured. For encoders with a Z index, wheel auto-centering is possible through firmware calibration.

Uploaded by

PIETREK PRO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

NEW EMC-M3 Tutorial

Supported Boards :
● BLACKPILL (STM32F103C8T6 64K)
● SMARTV2 (STM32F103C8T6 64K)
● ARDUINO LEONARDO (ATMEGA32U4)

Firmware Version :
● STM32F103C8T6 : V1.0.4
● ARDUINO LEONARDO : V1.02 (Because of the limitations of Arduino Leonardo, it won't
get any more updates, so this is the last version)

Firmware Changelog :
● Change FFB POOL memory%
● Fix FFB formula
● Reduce Ballast Force
● Smoothing Reducer (STM32 ONLY)
● Change Pedal,Handbrake,XYShifter Resolution to 16bits (STM32 ONLY)
● 64 button,8 XYShifter, 24 Button Matrix, 32Button Wireless (STM32 ONLY)
● Fix Z index Calibration (STM32 ONLY)
● Use standard PID,VID and DEVICE NAME (not detected as EMC)

NOTE : 32 Button Wireless transmitter not implemented yet


FLASHING FIRMWARE
ARDUINO LEONARDO

*Use XLOADER as usual

STM32F103C8T6

Method 1.Using ST-LINKV2

what you need :


1. ST-LINK FLASH Utility, download on tools folder or https://www.st.com/en/development-
tools/stsw-link004.html

Then Install all ,include the driver

2. ST-LINK V2 Programmer

ST-LINKV2 Clones

Plug ST-LINKV2 on Your win10,the driver will download automatically

For manual ST-LINKV2 driver installation:

https://www.st.com/en/development-tools/stsw-link009.html
ST-LINKV2 programmer detected on device manager

Connect Your ST-LINKV2 to the target “BLACKPILL/SMARTV2” Board,and make sure the
BOOT0 and BOOT1 jumper set to B0-,B1- (See normal operation mode on BLACKPILL PINOUT
above,for “SMARTV2” only set BOOT0)

Example ST-LINKV2 Connected to BLACKPILL

ST-LINK PIN ----- BLACKPILL PIN


3.3V(not5v!!) >>> 3.3V

GND >>> GND

SWDIO >>> DIO

SWCLK >>> CLK

NOTE : ST-LINKV2 Pins may vary, the Triangle mark on ST-LINK means pin1

For SMARTV2 variants

ST-LINK PIN ----- SMARTV2 PIN

3.3V(not5v!!) >>> VCC pin1 or pin2

GND >>> GND

SWDIO >>> SWDIO pin7

SWCLK >>> SWCLK pin9

NOTE : ST-LINKV2 Pins may vary, the Triangle mark on ST-LINK and SMARTV2 means pin1

plug ST-LINKV2 to the PC USB port, remember do not connect powered USB cable to the
Device ,Device will powered by ST-LINKV2
Open ST-LINK FLASH UTILITY

Click connect

Click Program Verify, and choose latest firmware version ex: EMC-M3Blackpill.hex file for
“BLACKPILL” variant,choose EMC-M3SmartV2.hex for “SMARTV2” variant (download from
firmware folder)
Click Start,Wait until finished

Click Disconnect from the target ,unplug ST-LINKV2 from usb and remove it from the
BLACKPILL/“SMARTV2” device
Method 2.Using USB TO TTL SERIAL

USB TO SERIAL PIN ----- BLACKPILL/SMARTV2 PIN

GND >>> GND

RX >>> PA9

TX >>> PA10

BLACKPILL/SMARTV2 device powered by USBcable.

IMPORTANT!! The device must be in SERIAL PROGRAMMING MODE,see Pinout above


BLACKPILL : SET BOOT0 JUMPER TO + (B0+)

SMARTV2 : SET BOOT0 JUMPER TO 3.3V

Video Tutorial: :

Serial Programming

After flash is Complete,turn back the Jumper to Normal Operation.

WIRING
See wiring scheme in wiring folder,and make sure your wiring is correct and properly connected
Example : STM32 Wiring schematics using Cytron Drive,Check the wiring
scheme in the wiring folder for the new schematics

UTILITY
Utility Changelog :
● Portable
● Classic Theme
● Simpler and lighter
● Custom Steering Image
● Telemetry dash Removed
● Settings File saved in current directory

Installing Utility :
Download EMCUtilityPortable.zip in the Utility folder, extract...

Note : remember because it's portable don't extract it in C: \ Program Files or C: \ Program Files
(x86) folder

Before start please note:


● Must have basic electrical knowledge
● Basic tools
● High quality spare parts (PSU, cable, encoder, motor, driver)
● Safety procedures
Lock or plant the motor rigidly, keep hair or cables away from the motor or steering wheel.
Encoder and motor work together, the motor needs an encoder to read position, place the
encoder directly on the motor or on the steering shaft with pulley connected to the motor.

SETTINGS

Encoder CPR : Encoder PPR X 4, example : encoder have 1000PPR,so fill with 4000

Note: The firmware doesn't support high resolution encoder(10000 PPR), so it is recommended
to use an encoder with a minimum 200PPR maximum 2000PPR

Use Encoder Z Index : For encoders with z index channel for first setup don't click it!!

Drive Mode : 1PWM+1DIR, 2PWM+1EN, 1PWM+2DIR (STM32 ONLY)

example : 1PWM + 1Dir for Cytron Driver,2PWM + 1EN for BTS Driver, 1PWM+2DIR for
MotoMonster or VNH 5019,another driver? Read the datasheet!!

Note: The firmware doesn't support BLDC MOTOR and Analog AC SERVO Controller!!

Drive Frequency : PWM TImer Frequency,small Frequency will cause motor singing and noisy,
but faster in processing,Higher Frequency more Silent and Smoother but slow in processing

Click the Close X button, to update the setup and return to Main Tab

MAIN TAB
Encoder Test

Turn on PSU

Turn the steering wheel slowly until it reaches the final angle, if you feel the stop effect then the
motor polarity is correct, and ready for FFB, but if the steering wheel rotates in the same direction
the motor polarity is wrong, fix it by turning the polarity cable (+/- motor cable) from the driver to
the motor (don't forget to turn off PSU First!!)
don't feel anything? Try increase the Strength Slider ,or check your driver Condition and Cables
STEERING

Angle : Maximum Steering Wheel Angle

Center Steering : to Re-Center Steering Wheel

Invert Steering : Invert Steering Input

PEDAL AND HANDBRAKE


CheckBox : To Enable/Disable Input

How to Calibrate : Release your pedal,and click “Set Min” button,now hold the pedal up to
where your pedal is at maximum position,then click “Set Max” button

Brake Linearity Mode : Enable Non-Linearity Brake Pedal Input (Advanced User)

SHIFTER
Note: This features only for Shifter with Analog sensor (Hall,PotentioMeter,etc),for digital shifter
(switch,limit switch,micro switch) with button matrix connection this setup will not be affected

Shifter Mode : H-Shifter or Sequential

How to Calibrate : Click Calibrate

Xshifter (Direction Left,Right)

Move shifter to the Left until the end,hold…. then click “Xmin”,Now Move to the Right until the
end,hold ...then click “Xmax”

Yshifter (Direction Top, Bottom)

Move shifter to the Bottom until the end,hold…. then click “Ymin”,Now Move to the Top until the
end,hold ...then click “Ymax”

Slide Yhigh, Ylow, Xhigh, Xmid and Xlow to adjust and adapt your mechanical shifters

FORCE
Strength : Maximum Force Strength

Reducer : Soft Resistance to reduce speed and some artificial friction effect (STM32 ONLY)

Ballast : Hard Resistance to make steering more heavier

Note : For belt systems if the reducer and ballast are too high, the FFB details will be lost

Steering Stop : To enable Artificial Steering Stop Effect

Steering Stop Offset : At what angle the steering stop will start? Formula : Steering angle -
Steering stop Offset

Softlock : Soft force based on offset


Hardlock : The maximum force of steering stop,more speed hit the stop, more force!

DESKTOP EFFECT
Note: it has an effect only on the desktop not in the game.

Auto Center : spring or rubber band effect for centering the wheel,only works on desktop,after
the game sends FFB signal,the effect totally turns off.
Coefficient : Auto center force multiplier.

Saturation : Limit or maximum force for Auto Center.

FFB TWEAK
Note: for Arduino not all have this effect (due to flash limitations), it is recommended to set all
default effects at 100%

Tweaking : 0 is OFF, 100 Default. 150 Maximum

Effects Playing Status : To see which effect is being used by the game ,(STM32 ONLY)

Indexing and Wheel Calibrating (experimental, STM32 ONLY)

Note: this is only for 3channel encoders that have an index (phase Z),for 2 channel encoder
never play with this feature
EMC-M3 firmware have indexing features,the wheel will be re-center automatically
so when the device is powered and the psu is on, the first time the device will look for a signal
index, the steering wheel will spin automatically, after the index is found, the wheel will calibrate
and RE-Center
First step connect as usual the encoder to device,but don’t connect the phase z to device,we will
check the voltage first,make sure phase Z have around 3,3V,if phase Z have correct voltage
connect it to PB8 pin on device

example OMRON CWZ6C has 3 channels,add resistor to all channel in order to work

Phase Z RISING signal on omron CWZ6C

HOW TO Calibrate the wheel

Note: this is only for 3channel encoders that have an index (phase Z),for 2 channel encoder
never play with this feature

click Settings (gear icon) button on Utility ,check the “Use Z Encoder Index” checkbox, slide the
slider "Index Search Force", don't set it too high, make sure the force is enough to make the
steering wheel rotate then click “Calibrate Index” button,the wheel will start rotates to the
right,left and center as seen on the device status,the device LED’s will flashing around 100ms,this
means the device is performing a calibration

“WARNING!! Please keep your hands off from the wheel during calibration process”

Searching Index

Index Found,this actual center Position.

Index Error,encoder will run in normal mode.

If index is found, but the steering wheel is not in the center


position, close the Settings tab, click Center Steering in
Steering tab

IMPORTANT !!!

After Pedals, Shifter, and Steering Z Index are calibrated, click “Save to Device”
Save to Device : Save and Update the Calibration results to the device EEPROM .

Use Default Set : Use Default Settings from Device and Clear device EEPROM.

EEPROM
EEPROM has 10000 Read / write lifecycles,
The Button ”Save to Device” and “Use Default Set” use the EEPROM features,This will reduce
the EEPROM life and endurance,please pay attention not too often, ideally calibrate the steering
(if use Z index),pedal,shifter and change the setup, just do it once in first setup,and don't touch
anymore unless forced to.

I apologize if there are writing errors, grammar errors and are not easy to understand, English is
not my native language,thank you for your support all this time.

Best Regards
EMC

You might also like