1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Tutorial SMC3 Arduino 3DOF Motor Driver and Windows Utilities

Discussion in 'SimTools compatible interfaces' started by RufusDufus, Dec 1, 2013.

  1. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Hey guys !
    Any idea if and how I can wire this board (http://uk.farnell.com/infineon/dcmo...uino-motor-control-shield-btn8982/dp/2453485#) with the Arduino using the SMC3 firmware?

    Thanks in advance
    Marco:)
  2. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,409Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    This DC Motor Control Shield from Infineon is compatible to Arduino. It is capable of driving two uni-directional DC motors (half bridge configuration) or one bi-directional DC motor (H-Bridge configuration).
    The implemented NovalithIC™ integrated half-bridge driver BTN8982TA can be controlled by a PWM via the IN Pin.
    Specs:
    „Brushed DC motor control up to 250W continuous load
    –8–18V nominal input voltage (max. 6–40V)
    –Average motor current 30A restricted due to PCB
    (BTN8982TA current limitation @ 55A min.)
    • Like Like x 2
    • Informative Informative x 1
  3. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Thanks Pit!
    Do you mean MODE2 will be enough for the purpose?

    One of this boards is coming in the next days. I will try it driving my actual motor at 24V.
    Despite the specs, it should work fine at 24..at least I hope so! Curious to see what will happen.

    I would like to continue using the SMC3 firmware which is great, unfortunately I'm afraid this particular boards need some tweaking in the firmware to properly work.
  4. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,409Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Hi I doubt if this driver will be capable of handling 24V...up to 18V nominal input voltage is not 24V even if the specs say something different. We will see.

    SMC needs always some tweaking :)
    Arduino Mode2 is needed as already mentioned.
  5. Lorien31

    Lorien31 Member Gold Contributor

    Joined:
    Aug 5, 2015
    Messages:
    32
    Occupation:
    IT System Specialist
    Location:
    Switzerland
    Balance:
    140Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Is it normal that i get the same Pot feedback on all 3 motors in the monitor tool, when only A0 has a actual pot connected ?
  6. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,409Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    yep.
    • Agree Agree x 3
  7. gorzasty

    gorzasty Active Member

    Joined:
    Apr 2, 2012
    Messages:
    151
    Occupation:
    photographer, IT specialist
    Location:
    Poland, Wrocław
    Balance:
    1,060Coins
    Ratings:
    +41 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hello @RufusDufus, I need to ask You one quenstion. Would it be much work with SMC3 software to give us an option that only negatives or positives valuses of parameters like sway or surge works for our motors? Your software is great at the moment and much more than enought if you build common rig, but in my case there is a problem if I want to have seat shaker and G-Seat with two Ardu. SimTools doesn't give us an option to configure each Ardu in the different way (I mean symetrical work +/-100% and asymetrical - 0-100%).

    If You want to know more details take a look at my threat please: http://www.xsimulator.net/community/threads/2dof-another-in-da-house.6764/page-5

    Really looking forward what are You thinking about it!

    Best Regards
  8. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,602Coins
    Ratings:
    +1,008 / 8 / -1
    I don't really understand why you only want half the data? Anyway if that is what you want then you need to make the following changes to the code:

    Search the software for the lines case 'A', case 'B' and case 'C' and add the if test lines as shown below:

    Code:
    case 'A':
        Target1=(RxBuffer[1][ComPort]*256)+RxBuffer[2][ComPort];
        if (Target1<0) { Target1 = 0; }    // <-- ADD This line of code
    
    ...
    
    case 'B':
        Target2=(RxBuffer[1][ComPort]*256)+RxBuffer[2][ComPort];
        if (Target2<0) { Target2 = 0; }    // <-- ADD This line of code
    
    ...
    
    case 'C':
        Target3=(RxBuffer[1][ComPort]*256)+RxBuffer[2][ComPort];
        if (Target3<0) { Target3 = 0; }    // <-- ADD This line of code
    
    
    • Winner Winner x 3
  9. gorzasty

    gorzasty Active Member

    Joined:
    Apr 2, 2012
    Messages:
    151
    Occupation:
    photographer, IT specialist
    Location:
    Poland, Wrocław
    Balance:
    1,060Coins
    Ratings:
    +41 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Wow! Thank You very much @RufusDufus, You are great!
    A lot of people dont understand my intentions, because don't make G-Seats. SimTools, just like arduino codes that You can find here, is for frex style platfroms. G-Seat work in a different way, and that is the problem. Plates behind Your back sholud move only when You accelerate, not when break. I made one more sketch to show You why the change I was asking is important:

    [​IMG]

    With the changes in the code I can give a try to run my G-Seat. Thank You one more time!
    • Informative Informative x 1
    Last edited: Sep 7, 2015
  10. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Excuse me if my question has been answered. A lot of reading on the community forum has been done in the past and I don't remember if it was ok. Can a 100K pot be used with Arduino Uno and SMC3. I purchased 20 precision pots in the late 90's at Tanner's Electronics. Don't laugh at my age. I feel and look 40.:grin I would really like to use them for there high quality build.
  11. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,916Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    They can be used if ALL the 10 turns are the actual mechanical usable range for your simulator "using gears "... otherwise it will affect the sensitivity of the feedback signal by 10 times worse .
    Last edited: Sep 10, 2015
  12. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,916Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    Hi @RufusDufus ...
    I was thinking about if you can upgrade the utility with these options to have :

    1- PID auto tuning button / wizard ...
    To save time when having a lot of possibilities with a lot of tuning options to get the best [motor with load] PID response [ since the utility has a motion output signal to be used ] ... so with a button/wizard having a three incremental selectable tuning levels [ Soft ,Medium ,Hard ] you get instantly the best platform overall final response before going to the game with SimTools ...​
    2- A center button in manual mode to place the target blue dot centered ... Please :thumbs .
    It is a mandatory request "Please" IF there is no motors auto tuning ...
    • because every time you move your motor 1 ,2 or 3 you loose the center point which is hard to spot with the mouse while in action .
    • second benefit will be that you can really level the platform or center the motor FB .
    • also it is useful to start/stop the manual mode with the blue dot centered by default ,so you don't have to search for it's center specially when switching to motor 2 or 3 .
    Thanks buddy for all the efforts .
    • Agree Agree x 4
    Last edited: Sep 10, 2015
  13. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,602Coins
    Ratings:
    +1,008 / 8 / -1
    Hi @speedy, I'll have a look and see what I can do. ;)
    • Like Like x 5
    • Winner Winner x 1
    • Friendly Friendly x 1
  14. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,916Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    Thanks @RufusDufus ... You are the man :thumbs ... this one's on me :cheers


    ef8f94395be9fd78b7d0aeecf7864a03.jpg
    • Friendly Friendly x 4
  15. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,158
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,176Coins
    Ratings:
    +2,156 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    I know the answer is back there somewhere in the last 35 pages or so but I cannot find it so I am going to ask it again :)

    I have the stock settings in SMC3 using version .63. In game motor 1 will drop out and it takes an arduino reset (unplug and plug) to get it to work again. I know that the issue is with my configuration and that it has been asked and answered before, but again; I cannot find it back there. For motor drivers I am using Pololu 755s in pairs for 30amp max output (thanks Pit!). The rig shakes the whatzits out of you when it is working :)

    Suggestion: Someone might gather the Problems and Solutions together an some type of FAQ to make it easier to find them. (Yes, I know that I suggested it and I really should do this myself, lol. As soon as I have spare time......2060 ish?) :D

    Once again; Thank you RufusDufus, you are Da Man!
  16. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,460
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    With respect to troubleshooting it really helps to post screenshots of your settings, particularly when you believe them to be the issue.

    I would be happy to help out with FAQ Problems and Solutions, but as I am not a SMC3 user would want some pointers as to what is actually needed and current. Just having a quick look at the first few pages of the thread would suggest some of the early issues and information are redundant because of things like SimTools bug fixes. If actual SMC3 users can point to the key issues and solutions then I am happy to compile them for the FAQs.
    • Friendly Friendly x 2
  17. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Finally I've tried this H-Bridge.
    At 24V it moves up but can't turn my motor down. Maybe the peak of current is too high.
    I can't imagine how could it work with less powerful motors..
  18. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,409Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF


    Sorry mate but you have been "warned" :)
  19. gorzasty

    gorzasty Active Member

    Joined:
    Apr 2, 2012
    Messages:
    151
    Occupation:
    photographer, IT specialist
    Location:
    Poland, Wrocław
    Balance:
    1,060Coins
    Ratings:
    +41 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hello @RufusDufus

    Regarding to Your earlier post:

    I've got error tried to compile this. Could You take a look please?

    Code:
    SMC3_for_GSeat.ino:85:15: error: redefinition of 'long unsigned int TimesUp'
    SMC3.ino:85:15: error: 'long unsigned int TimesUp' previously defined here
    SMC3_for_GSeat.ino:87:5: error: redefinition of 'int Feedback1'
    SMC3.ino:87:5: error: 'int Feedback1' previously defined here
    SMC3_for_GSeat.ino:88:5: error: redefinition of 'int Feedback2'
    SMC3.ino:88:5: error: 'int Feedback2' previously defined here
    SMC3_for_GSeat.ino:89:5: error: redefinition of 'int Feedback3'
    SMC3.ino:89:5: error: 'int Feedback3' previously defined here
    SMC3_for_GSeat.ino:90:5: error: redefinition of 'int Target1'
    SMC3.ino:90:5: error: 'int Target1' previously defined here
    SMC3_for_GSeat.ino:91:5: error: redefinition of 'int Target2'
    SMC3.ino:91:5: error: 'int Target2' previously defined here
    SMC3_for_GSeat.ino:92:5: error: redefinition of 'int Target3'
    SMC3.ino:92:5: error: 'int Target3' previously defined here
    SMC3_for_GSeat.ino:93:5: error: redefinition of 'int PotInput'
    SMC3.ino:93:5: error: 'int PotInput' previously defined here
    SMC3_for_GSeat.ino:95:22: error: redefinition of 'unsigned int RxByte [2]'
    SMC3.ino:95:14: error: 'unsigned int RxByte [2]' previously defined here
    SMC3_for_GSeat.ino:96:16: error: redefinition of 'int BufferEnd [2]'
    SMC3.ino:96:5: error: 'int BufferEnd [2]' previously defined here
    SMC3_for_GSeat.ino:97:27: error: redefinition of 'unsigned int RxBuffer [5][2]'
    SMC3.ino:97:14: error: 'unsigned int RxBuffer [5][2]' previously defined here
    SMC3_for_GSeat.ino:98:15: error: redefinition of 'long unsigned int LoopCount'
    SMC3.ino:98:15: error: 'long unsigned int LoopCount' previously defined here
    SMC3_for_GSeat.ino:99:15: error: redefinition of 'long unsigned int LastCount'
    SMC3.ino:99:15: error: 'long unsigned int LastCount' previously defined here
    SMC3_for_GSeat.ino:100:6: error: redefinition of 'byte errorcount'
    SMC3.ino:100:6: error: 'byte errorcount' previously defined here
    SMC3_for_GSeat.ino:101:14: error: redefinition of 'unsigned int CommsTimeout'
    SMC3.ino:101:14: error: 'unsigned int CommsTimeout' previously defined here
    SMC3_for_GSeat.ino:102:6: error: redefinition of 'byte PowerScale'
    SMC3.ino:102:6: error: 'byte PowerScale' previously defined here
    SMC3_for_GSeat.ino:133:5: error: redefinition of 'int OutputPort'
    SMC3.ino:133:5: error: 'int OutputPort' previously declared here
    SMC3_for_GSeat.ino:134:11: error: redefinition of 'const int ENApin1'
    SMC3.ino:134:11: error: 'const int ENApin1' previously defined here
    SMC3_for_GSeat.ino:135:11: error: redefinition of 'const int ENBpin1'
    SMC3.ino:135:11: error: 'const int ENBpin1' previously defined here
    SMC3_for_GSeat.ino:136:11: error: redefinition of 'const int ENApin2'
    SMC3.ino:136:11: error: 'const int ENApin2' previously defined here
    SMC3_for_GSeat.ino:137:11: error: redefinition of 'const int ENBpin2'
    SMC3.ino:137:11: error: 'const int ENBpin2' previously defined here
    SMC3_for_GSeat.ino:138:11: error: redefinition of 'const int ENApin3'
    SMC3.ino:138:11: error: 'const int ENApin3' previously defined here
    SMC3_for_GSeat.ino:139:11: error: redefinition of 'const int ENBpin3'
    SMC3.ino:139:11: error: 'const int ENBpin3' previously defined here
    SMC3_for_GSeat.ino:140:11: error: redefinition of 'const int PWMpin1'
    SMC3.ino:140:11: error: 'const int PWMpin1' previously defined here
    SMC3_for_GSeat.ino:141:11: error: redefinition of 'const int PWMpin2'
    SMC3.ino:141:11: error: 'const int PWMpin2' previously defined here
    SMC3_for_GSeat.ino:142:11: error: redefinition of 'const int PWMpin3'
    SMC3.ino:142:11: error: 'const int PWMpin3' previously defined here
    SMC3_for_GSeat.ino:143:11: error: redefinition of 'const int FeedbackPin1'
    SMC3.ino:143:11: error: 'const int FeedbackPin1' previously defined here
    SMC3_for_GSeat.ino:144:11: error: redefinition of 'const int FeedbackPin2'
    SMC3.ino:144:11: error: 'const int FeedbackPin2' previously defined here
    SMC3_for_GSeat.ino:145:11: error: redefinition of 'const int FeedbackPin3'
    SMC3.ino:145:11: error: 'const int FeedbackPin3' previously defined here
    SMC3_for_GSeat.ino:146:11: error: redefinition of 'const int PotInputPin'
    SMC3.ino:146:11: error: 'const int PotInputPin' previously defined here
    SMC3_for_GSeat.ino:148:5: error: redefinition of 'int DeadZone1'
    SMC3.ino:148:5: error: 'int DeadZone1' previously defined here
    SMC3_for_GSeat.ino:149:5: error: redefinition of 'int DeadZone2'
    SMC3.ino:149:5: error: 'int DeadZone2' previously defined here
    SMC3_for_GSeat.ino:150:5: error: redefinition of 'int DeadZone3'
    SMC3.ino:150:5: error: 'int DeadZone3' previously defined here
    SMC3_for_GSeat.ino:152:5: error: redefinition of 'int CenterOffset1'
    SMC3.ino:152:5: error: 'int CenterOffset1' previously defined here
    SMC3_for_GSeat.ino:153:5: error: redefinition of 'int CenterOffset2'
    SMC3.ino:153:5: error: 'int CenterOffset2' previously defined here
    SMC3_for_GSeat.ino:154:5: error: redefinition of 'int CenterOffset3'
    SMC3.ino:154:5: error: 'int CenterOffset3' previously defined here
    SMC3_for_GSeat.ino:156:5: error: redefinition of 'int CutoffLimitMax1'
    SMC3.ino:156:5: error: 'int CutoffLimitMax1' previously defined here
    SMC3_for_GSeat.ino:157:5: error: redefinition of 'int CutoffLimitMax2'
    SMC3.ino:157:5: error: 'int CutoffLimitMax2' previously defined here
    SMC3_for_GSeat.ino:158:5: error: redefinition of 'int CutoffLimitMax3'
    SMC3.ino:158:5: error: 'int CutoffLimitMax3' previously defined here
    SMC3_for_GSeat.ino:159:5: error: redefinition of 'int CutoffLimitMin1'
    SMC3.ino:159:5: error: 'int CutoffLimitMin1' previously defined here
    SMC3_for_GSeat.ino:160:5: error: redefinition of 'int CutoffLimitMin2'
    SMC3.ino:160:5: error: 'int CutoffLimitMin2' previously defined here
    SMC3_for_GSeat.ino:161:5: error: redefinition of 'int CutoffLimitMin3'
    SMC3.ino:161:5: error: 'int CutoffLimitMin3' previously defined here
    SMC3_for_GSeat.ino:163:5: error: redefinition of 'int InputClipMax1'
    SMC3.ino:163:5: error: 'int InputClipMax1' previously defined here
    SMC3_for_GSeat.ino:164:5: error: redefinition of 'int InputClipMax2'
    SMC3.ino:164:5: error: 'int InputClipMax2' previously defined here
    SMC3_for_GSeat.ino:165:5: error: redefinition of 'int InputClipMax3'
    SMC3.ino:165:5: error: 'int InputClipMax3' previously defined here
    SMC3_for_GSeat.ino:166:5: error: redefinition of 'int InputClipMin1'
    SMC3.ino:166:5: error: 'int InputClipMin1' previously defined here
    SMC3_for_GSeat.ino:167:5: error: redefinition of 'int InputClipMin2'
    SMC3.ino:167:5: error: 'int InputClipMin2' previously defined here
    SMC3_for_GSeat.ino:168:5: error: redefinition of 'int InputClipMin3'
    SMC3.ino:168:5: error: 'int InputClipMin3' previously defined here
    SMC3_for_GSeat.ino:171:5: error: redefinition of 'int LiftFactor1'
    SMC3.ino:171:5: error: 'int LiftFactor1' previously defined here
    SMC3_for_GSeat.ino:172:5: error: redefinition of 'int LiftFactor2'
    SMC3.ino:172:5: error: 'int LiftFactor2' previously defined here
    SMC3_for_GSeat.ino:174:5: error: redefinition of 'int PIDProcessDivider'
    SMC3.ino:174:5: error: 'int PIDProcessDivider' previously defined here
    SMC3_for_GSeat.ino:175:5: error: redefinition of 'int PIDProcessCounter'
    SMC3.ino:175:5: error: 'int PIDProcessCounter' previously defined here
    SMC3_for_GSeat.ino:176:5: error: redefinition of 'int SerialFeedbackCounter'
    SMC3.ino:176:5: error: 'int SerialFeedbackCounter' previously defined here
    SMC3_for_GSeat.ino:177:5: error: redefinition of 'int SerialFeedbackEnabled'
    SMC3.ino:177:5: error: 'int SerialFeedbackEnabled' previously defined here
    SMC3_for_GSeat.ino:178:5: error: redefinition of 'int SerialFeedbackPort'
    SMC3.ino:178:5: error: 'int SerialFeedbackPort' previously defined here
    SMC3_for_GSeat.ino:180:5: error: redefinition of 'int Ks1'
    SMC3.ino:180:5: error: 'int Ks1' previously defined here
    SMC3_for_GSeat.ino:181:6: error: redefinition of 'long int Kp1_x100'
    SMC3.ino:181:6: error: 'long int Kp1_x100' previously defined here
    SMC3_for_GSeat.ino:182:6: error: redefinition of 'long int Ki1_x100'
    SMC3.ino:182:6: error: 'long int Ki1_x100' previously defined here
    SMC3_for_GSeat.ino:183:6: error: redefinition of 'long int Kd1_x100'
    SMC3.ino:183:6: error: 'long int Kd1_x100' previously defined here
    SMC3_for_GSeat.ino:184:5: error: redefinition of 'int Ks2'
    SMC3.ino:184:5: error: 'int Ks2' previously defined here
    SMC3_for_GSeat.ino:185:6: error: redefinition of 'long int Kp2_x100'
    SMC3.ino:185:6: error: 'long int Kp2_x100' previously defined here
    SMC3_for_GSeat.ino:186:6: error: redefinition of 'long int Ki2_x100'
    SMC3.ino:186:6: error: 'long int Ki2_x100' previously defined here
    SMC3_for_GSeat.ino:187:6: error: redefinition of 'long int Kd2_x100'
    SMC3.ino:187:6: error: 'long int Kd2_x100' previously defined here
    SMC3_for_GSeat.ino:188:5: error: redefinition of 'int Ks3'
    SMC3.ino:188:5: error: 'int Ks3' previously defined here
    SMC3_for_GSeat.ino:189:5: error: redefinition of 'int Kp3_x100'
    SMC3.ino:189:5: error: 'int Kp3_x100' previously defined here
    SMC3_for_GSeat.ino:190:5: error: redefinition of 'int Ki3_x100'
    SMC3.ino:190:5: error: 'int Ki3_x100' previously defined here
    SMC3_for_GSeat.ino:191:5: error: redefinition of 'int Kd3_x100'
    SMC3.ino:191:5: error: 'int Kd3_x100' previously defined here
    SMC3_for_GSeat.ino:192:5: error: redefinition of 'int PWMout1'
    SMC3.ino:192:5: error: 'int PWMout1' previously defined here
    SMC3_for_GSeat.ino:193:5: error: redefinition of 'int PWMout2'
    SMC3.ino:193:5: error: 'int PWMout2' previously defined here
    SMC3_for_GSeat.ino:194:5: error: redefinition of 'int PWMout3'
    SMC3.ino:194:5: error: 'int PWMout3' previously defined here
    SMC3_for_GSeat.ino:196:5: error: redefinition of 'int Disable1'
    SMC3.ino:196:5: error: 'int Disable1' previously defined here
    SMC3_for_GSeat.ino:197:5: error: redefinition of 'int Disable2'
    SMC3.ino:197:5: error: 'int Disable2' previously defined here
    SMC3_for_GSeat.ino:198:5: error: redefinition of 'int Disable3'
    SMC3.ino:198:5: error: 'int Disable3' previously defined here
    SMC3_for_GSeat.ino:199:5: error: redefinition of 'int PWMoffset1'
    SMC3.ino:199:5: error: 'int PWMoffset1' previously defined here
    SMC3_for_GSeat.ino:200:5: error: redefinition of 'int PWMoffset2'
    SMC3.ino:200:5: error: 'int PWMoffset2' previously defined here
    SMC3_for_GSeat.ino:201:5: error: redefinition of 'int PWMoffset3'
    SMC3.ino:201:5: error: 'int PWMoffset3' previously defined here
    SMC3_for_GSeat.ino:202:5: error: redefinition of 'int PWMmax1'
    SMC3.ino:202:5: error: 'int PWMmax1' previously defined here
    SMC3_for_GSeat.ino:203:5: error: redefinition of 'int PWMmax2'
    SMC3.ino:203:5: error: 'int PWMmax2' previously defined here
    SMC3_for_GSeat.ino:204:5: error: redefinition of 'int PWMmax3'
    SMC3.ino:204:5: error: 'int PWMmax3' previously defined here
    SMC3_for_GSeat.ino:205:5: error: redefinition of 'int PWMrev1'
    SMC3.ino:205:5: error: 'int PWMrev1' previously defined here
    SMC3_for_GSeat.ino:206:5: error: redefinition of 'int PWMrev2'
    SMC3.ino:206:5: error: 'int PWMrev2' previously defined here
    SMC3_for_GSeat.ino:207:5: error: redefinition of 'int PWMrev3'
    SMC3.ino:207:5: error: 'int PWMrev3' previously defined here
    SMC3_for_GSeat.ino:208:14: error: redefinition of 'unsigned int Timer1FreqkHz'
    SMC3.ino:208:14: error: 'unsigned int Timer1FreqkHz' previously defined here
    SMC3_for_GSeat.ino:209:14: error: redefinition of 'unsigned int Timer2FreqkHz'
    SMC3.ino:209:14: error: 'unsigned int Timer2FreqkHz' previously defined here
    SMC3_for_GSeat.ino: In function 'void setPwmFrequency(int, int)':
    SMC3_for_GSeat.ino:221:6: error: redefinition of 'void setPwmFrequency(int, int)'
    SMC3.ino:221:6: error: 'void setPwmFrequency(int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void InitialisePWMTimer1(unsigned int)':
    SMC3_for_GSeat.ino:264:6: error: redefinition of 'void InitialisePWMTimer1(unsigned int)'
    SMC3.ino:264:6: error: 'void InitialisePWMTimer1(unsigned int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void InitialisePWMTimer2(unsigned int)':
    SMC3_for_GSeat.ino:284:6: error: redefinition of 'void InitialisePWMTimer2(unsigned int)'
    SMC3.ino:284:6: error: 'void InitialisePWMTimer2(unsigned int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void MyPWMWrite(uint8_t, uint8_t)':
    SMC3_for_GSeat.ino:300:6: error: redefinition of 'void MyPWMWrite(uint8_t, uint8_t)'
    SMC3.ino:300:6: error: 'void MyPWMWrite(uint8_t, uint8_t)' previously defined here
    SMC3_for_GSeat.ino: In function 'void setup()':
    SMC3_for_GSeat.ino:350:6: error: redefinition of 'void setup()'
    SMC3.ino:350:6: error: 'void setup()' previously defined here
    SMC3_for_GSeat.ino: In function 'void WriteEEPRomWord(int, int)':
    SMC3_for_GSeat.ino:390:6: error: redefinition of 'void WriteEEPRomWord(int, int)'
    SMC3.ino:390:6: error: 'void WriteEEPRomWord(int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'int ReadEEPRomWord(int)':
    SMC3_for_GSeat.ino:399:5: error: redefinition of 'int ReadEEPRomWord(int)'
    SMC3.ino:399:5: error: 'int ReadEEPRomWord(int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void WriteEEProm()':
    SMC3_for_GSeat.ino:414:6: error: redefinition of 'void WriteEEProm()'
    SMC3.ino:414:6: error: 'void WriteEEProm()' previously defined here
    SMC3_for_GSeat.ino: In function 'void ReadEEProm()':
    SMC3_for_GSeat.ino:465:6: error: redefinition of 'void ReadEEProm()'
    SMC3.ino:465:6: error: 'void ReadEEProm()' previously defined here
    SMC3_for_GSeat.ino: In function 'void SendTwoValues(int, int, int, int)':
    SMC3_for_GSeat.ino:529:6: error: redefinition of 'void SendTwoValues(int, int, int, int)'
    SMC3.ino:529:6: error: 'void SendTwoValues(int, int, int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void SendValue(int, int, int)':
    SMC3_for_GSeat.ino:557:6: error: redefinition of 'void SendValue(int, int, int)'
    SMC3.ino:557:6: error: 'void SendValue(int, int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'int DeltaLoopCount()':
    SMC3_for_GSeat.ino:590:5: error: redefinition of 'int DeltaLoopCount()'
    SMC3.ino:590:5: error: 'int DeltaLoopCount()' previously defined here
    SMC3_for_GSeat.ino: In function 'void ParseCommand(int)':
    SMC3_for_GSeat.ino:614:6: error: redefinition of 'void ParseCommand(int)'
    SMC3.ino:614:6: error: 'void ParseCommand(int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void CheckSerial0()':
    SMC3_for_GSeat.ino:1024:6: error: redefinition of 'void CheckSerial0()'
    SMC3.ino:1021:6: error: 'void CheckSerial0()' previously defined here
    SMC3_for_GSeat.ino: In function 'void CheckSerial1()':
    SMC3_for_GSeat.ino:1055:6: error: redefinition of 'void CheckSerial1()'
    SMC3.ino:1052:6: error: 'void CheckSerial1()' previously defined here
    SMC3_for_GSeat.ino: In function 'void SetOutputsMotor1()':
    SMC3_for_GSeat.ino:1096:6: error: redefinition of 'void SetOutputsMotor1()'
    SMC3.ino:1093:6: error: 'void SetOutputsMotor1()' previously defined here
    SMC3_for_GSeat.ino: In function 'void SetOutputsMotor2()':
    SMC3_for_GSeat.ino:1145:6: error: redefinition of 'void SetOutputsMotor2()'
    SMC3.ino:1142:6: error: 'void SetOutputsMotor2()' previously defined here
    SMC3_for_GSeat.ino: In function 'void SetOutputsMotor3()':
    SMC3_for_GSeat.ino:1194:6: error: redefinition of 'void SetOutputsMotor3()'
    SMC3.ino:1191:6: error: 'void SetOutputsMotor3()' previously defined here
    SMC3_for_GSeat.ino: In function 'int CalcMotor1PID(int, int)':
    SMC3_for_GSeat.ino:1401:5: error: redefinition of 'int CalcMotor1PID(int, int)'
    SMC3.ino:1398:5: error: 'int CalcMotor1PID(int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'int CalcMotor2PID(int, int)':
    SMC3_for_GSeat.ino:1438:5: error: redefinition of 'int CalcMotor2PID(int, int)'
    SMC3.ino:1435:5: error: 'int CalcMotor2PID(int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'int CalcMotor3PID(int, int)':
    SMC3_for_GSeat.ino:1479:5: error: redefinition of 'int CalcMotor3PID(int, int)'
    SMC3.ino:1476:5: error: 'int CalcMotor3PID(int, int)' previously defined here
    SMC3_for_GSeat.ino: In function 'void DisableMotor1()':
    SMC3_for_GSeat.ino:1528:6: error: redefinition of 'void DisableMotor1()'
    SMC3.ino:1525:6: error: 'void DisableMotor1()' previously defined here
    SMC3_for_GSeat.ino: In function 'void DisableMotor2()':
    SMC3_for_GSeat.ino:1541:6: error: redefinition of 'void DisableMotor2()'
    SMC3.ino:1538:6: error: 'void DisableMotor2()' previously defined here
    SMC3_for_GSeat.ino: In function 'void DisableMotor3()':
    SMC3_for_GSeat.ino:1554:6: error: redefinition of 'void DisableMotor3()'
    SMC3.ino:1551:6: error: 'void DisableMotor3()' previously defined here
    SMC3_for_GSeat.ino: In function 'void TogglePin()':
    SMC3_for_GSeat.ino:1568:6: error: redefinition of 'void TogglePin()'
    SMC3.ino:1565:6: error: 'void TogglePin()' previously defined here
    SMC3_for_GSeat.ino: In function 'void loop()':
    SMC3_for_GSeat.ino:1581:6: error: redefinition of 'void loop()'
    SMC3.ino:1578:6: error: 'void loop()' previously defined here
    Błąd kompilacji.
    
    BTW the SMC3 0.7 code after the changes is HERE: SMC3_for_GSeat.ino - 60 KB
  20. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,602Coins
    Ratings:
    +1,008 / 8 / -1
    Hi @speedy, new version SMC3Utils v1.00 has been posted with buttons that center the motors in manual mode. The buttons are next to the slider. Don't forget to keep your own SMC3Utils.ini file

    I haven't yet worked out how to do auto tuning of PID.
    • Winner Winner x 5
    • Like Like x 1